<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>考勤查询</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->



		<script type="text/javascript"
			src="/SBD_OASystem/jQuery/jquery-1.9.1.js"></script>

		<script type="text/javascript">
		
	function getAttsByEmpno(empno) {
		window.location = "/SBD_OASystem/ch/att!getAttByEmpno.action?empno="
				+ empno;
				alert(empno);
	}
	
	function goUp(){
		var val = document.getElementById("year");
		val.value-=1;
	}
	
	
	function goNext(){
		var val = document.getElementById("year");
		val.value=val.value*1+1;
	}
</script>
	</head>

	<body>
		<h3>
			考勤查询
		</h3>

		<form action="/SBD_OASystem/ch/att!getAttsByExp.action" method="post">
			
			<img id="up" src="images/ch/up.jpg" style="width:20px ;height:20px;" onclick="goUp()"/>
			<input type="text" id="year" name="year" value="2013" />
			<img id="next" src="images/ch/next.jpg" style="width:20px ;height:20px;" onclick="goNext()"/>


			<select id="month" name="month">
				<option value="1">
					一 月
				</option>
				<option value="2">
					二 月
				</option>
				<option value="3">
					三 月
				</option>
				<option value="4">
					四 月
				</option>
				<option value="5">
					五 月
				</option>
				<option value="6">
					六月
				</option>
				<option value="7">
					七 月
				</option>
				<option value="8">
					八 月
				</option>
				<option value="9">
					九 月
				</option>
				<option value="10">
					十 月
				</option>
				<option value="11">
					十一月
				</option>
				<option value="12">
					十二月
				</option>
			</select>

			<br />

			<label>
				部门
			</label>
			<select name="deptno">
				<option value="">
					--请选择--
				</option>
				<s:iterator value="depts" var="dept">
					<option value="<s:property value="#dept.deptno"/>">
						<s:property value="#dept.dname" />
					</option>
				</s:iterator>
			</select>

			<label>
				姓名
			</label>
			<input type="text" name="att.emp.ename" />

			<label>
				工号
			</label>
			<input type="text" name="att.empno" />
			<input type="submit" value="查询" />
		</form>
		<table>
			<tr>
				<th>
					考勤时间
				</th>
				<th>
					工号
				</th>
				<th>
					姓名
				</th>
				<th>
					考勤
				</th>
				<th>
					备注
				</th>
			</tr>
			<s:iterator value="atts" var="att">
				<tr onclick="getAttsByEmpno(<s:property value="#att.empno"/>)">
					<td>
						<s:property value="#att.atttime" />
					</td>
					<td>
						<s:property value="#att.empno" />
					</td>
					<td>
						<s:property value="#att.emp.ename" />
					</td>
					<td>
						<s:property value="#att.state" />
						<s:if test="#att.state==1">
	  						迟到
	  					</s:if>
						<s:if test="#att.state==2">
	  						早退
	  					</s:if>

					</td>
					<td></td>
					<td>
						&quot;
					</td>
				</tr>

			</s:iterator>

		</table>
	</body>
</html>
